/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.srcptit.trainning.b2;

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.math.BigInteger;
import java.util.StringTokenizer;

/**
 *
 * @author Administrator
 */
public class Bai4SoNguyenLon {
    public static void main(String[] args) {
        BigInteger a, b;
        try{
            BufferedReader br = new BufferedReader(new FileReader("B4Data.txt"));
            String s = "", s1 = null;
            while(br.ready()){
                s1 = br.readLine();
                s=s+s1+"\n";
            }
            StringTokenizer sub = new StringTokenizer(s);            
            a = new BigInteger(sub.nextToken()); 
            b = new BigInteger(sub.nextToken()); 
            System.out.println(b); System.out.println(a+" "+b);
            System.out.println(a+" + "+b+" = "+a.add(b));
            System.out.println(a+" - "+b+" = "+a.subtract(b));
            System.out.println(a+" * "+b+" = "+a.multiply(b));
            System.out.println(a+" / "+b+" = "+a.divide(b));
            br.close();
        }catch(FileNotFoundException e){
            System.out.println("Không tìm thấy file");
        }catch(NumberFormatException e){
            System.out.println("Định dạng dữ liệu sai");
        }catch(Exception e){
            System.out.println("Lỗi không xác định");
        }finally{
            System.out.println("Done!");
        }
    }
}
